home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 958 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.9 KB

  1. Date: Sun, 30 Jan 94 06:33:53 PST
  2. From: hyc@hanauma.jpl.nasa.gov (Howard Chu)
  3. Message-Id: <9401301433.AA03929@hanauma.jpl.nasa.gov>
  4. To: mint@atari.archive.umich.edu
  5. Subject: Millisecond-based alarm
  6.  
  7. I found Talarm to be pretty reliable, but I needed finer resolution, so I've
  8. added a Tmalarm that doesn't convert to seconds, etc. Talarm just calls
  9. Tmalarm now. It seems like a useful addition, what do you folks think?
  10. *** 1.1    1994/01/30 14:11:23
  11. --- dos.c    1994/01/30 14:29:10
  12. ***************
  13. *** 360,363 ****
  14. --- 360,378 ----
  15.   {
  16.       long oldalarm;
  17. +     oldalarm = t_malarm(x*1000);
  18. +     oldalarm = (oldalarm+999) / 1000;    /* convert to seconds */
  19. +     return oldalarm;
  20. + }
  21. + /*
  22. +  * t_malarm(x): set the alarm clock to go off in "x" milliseconds. returns
  23. +  * the old value ofthe alarm clock
  24. +  */
  25. + long ARGS_ON_STACK
  26. + t_malarm(x)
  27. +     long x;
  28. + {
  29. +     long oldalarm;
  30.       TIMEOUT *t;
  31.   
  32. ***************
  33. *** 378,383 ****
  34.       }
  35.   
  36. -     oldalarm = (oldalarm+999) / 1000;    /* convert to seconds */
  37.   /* we were just querying the alarm */
  38.       if (x < 0)
  39. --- 393,396 ----
  40. ***************
  41. *** 388,394 ****
  42.           canceltimeout(curproc->alarmtim);
  43.   
  44. ! /* add a new alarm, to occur in 1000*x milliseconds */
  45.       if (x)
  46. !         curproc->alarmtim = addtimeout(1000*x, alarmme);
  47.       else
  48.           curproc->alarmtim = 0;
  49. --- 401,407 ----
  50.           canceltimeout(curproc->alarmtim);
  51.   
  52. ! /* add a new alarm, to occur in x milliseconds */
  53.       if (x)
  54. !         curproc->alarmtim = addtimeout(x, alarmme);
  55.       else
  56.           curproc->alarmtim = 0;
  57. ***************
  58. *** 589,591 ****
  59. --- 602,605 ----
  60.       dos_tab[0x13b] = d_getcwd;
  61.       dos_tab[0x13c] = s_alert;
  62. +     dos_tab[0x13d] = t_malarm;
  63.   }
  64. *** 1.3    1994/01/30 13:04:54
  65. --- proto.h    1994/01/30 14:22:44
  66. ***************
  67. *** 86,89 ****
  68. --- 86,90 ----
  69.   long ARGS_ON_STACK p_pause P_((void));
  70.   long ARGS_ON_STACK t_alarm P_((long x));
  71. + long ARGS_ON_STACK t_malarm P_((long x));
  72.   long ARGS_ON_STACK s_ysconf P_((int which));
  73.   long ARGS_ON_STACK s_alert P_((char *msg));
  74.